Transforms for large video and image blocks

ABSTRACT

Improved transforms are used to encode and decode large video and image blocks. During encoding, a prediction residual block having a large size (e.g., larger than 32×32) is generated. The pixel values of the prediction residual block are transformed to produce transform coefficients. After determining that the transform coefficients exceed a threshold cardinality representative of a maximum transform block size (e.g., 32×32), a number of the transform coefficients are discarded such that a remaining number of transform coefficients does not exceed the threshold cardinality. A transform block is then generated using the remaining number. During decoding, after determining that the transform coefficients exceed the threshold cardinality, a number of new coefficients are added to the transform coefficients such that a total number of transform coefficients exceeds the threshold cardinality. The transform coefficients are then inverse transformed into a prediction residual block having a large size.

BACKGROUND

Digital video streams may represent video using a sequence of frames or still images. Digital video can be used for various applications including, for example, video conferencing, high definition video entertainment, video advertisements, or sharing of user-generated videos. A digital video stream can contain a large amount of data and consume a significant amount of computing or communication resources of a computing device for processing, transmission, or storage of the video data. Various approaches have been proposed to reduce the amount of data in video streams, including encoding or decoding techniques.

SUMMARY

A method for encoding a current block of a video frame according to an implementation of this disclosure comprises generating a prediction residual block for the current block. The prediction residual block includes pixel values and has a first size. The method further comprises transforming the pixel values of the prediction residual block to produce transform coefficients. The method further comprises determining that the transform coefficients exceed a threshold cardinality. The method further comprises, responsive to determining that the transform coefficients exceed the threshold cardinality, discarding a number of the transform coefficients such that a remaining number of the transform coefficients does not exceed the threshold cardinality. The method further comprises generating a transform block using the remaining number of the transform coefficients. The transform block has a second size smaller than the first size. The method further comprises quantizing the remaining number of the transform coefficients within the transform block to produce quantized transform coefficients. The method further comprises encoding the quantized transform coefficients to a bitstream.

An apparatus for encoding a current block of a video frame according to an implementation of this disclosure comprises a processor configured to execute instructions stored in a non-transitory storage medium. The instructions include instructions to generate a prediction residual block for the current block. The instructions further include instructions to transform pixel values of the prediction residual block to produce transform coefficients. The transform coefficients include a first portion and a second portion. The instructions further include instructions to determine that the transform coefficients exceed a threshold cardinality representing a maximum transform block size for the transform coefficients. The instructions further include instructions to, responsive to a determination that the transform coefficients exceed the threshold cardinality, generate a transform block without using the second portion of the transform coefficients. The first portion of the transform coefficients does not exceed the threshold cardinality. The instructions further include instructions to quantize the first portion of the transform coefficients within the transform block to produce quantized transform coefficients. The instructions further include instructions to encode the quantized transform coefficients to a bitstream.

A method for encoding a current block of a video frame according to an implementation of this disclosure comprises generating a prediction residual block for the current block. The prediction residual block has a first block size. The method further comprises transforming pixel values of the prediction residual to produce transform coefficients. The transform coefficients include a first portion and a second portion. The method further comprises generating a transform block using the first portion of the transform coefficients. The transform block has a second block size smaller than the first block size. Generating the transform block for the first portion of the transform coefficients includes discarding the second portion of the transform coefficients. The method further comprises quantizing the first portion of the transform coefficients within the transform block to produce quantized transform coefficients. The method further comprises encoding the quantized transform coefficients to a bitstream.

These and other aspects of this disclosure are disclosed in the following detailed description of the implementations, the appended claims and the accompanying figures.

BRIEF DESCRIPTION OF THE DRAWINGS

The description herein makes reference to the accompanying drawings described below, wherein like reference numerals refer to like parts throughout the several views.

FIG. 1 is a schematic of an example of a video encoding and decoding system.

FIG. 2 is a block diagram of an example of a computing device that can implement a transmitting station or a receiving station.

FIG. 3 is a diagram of an example of a video stream to be encoded and subsequently decoded.

FIG. 4 is a block diagram of an example of an encoder according to implementations of this disclosure.

FIG. 5 is a block diagram of an example of a decoder according to implementations of this disclosure.

FIG. 6 is a block diagram of example of functionality of a transform stage used to transform a large prediction residual block.

FIG. 7 is a block diagram of example of functionality of an inverse transform stage used to inverse transform dequantized coefficients into a large prediction residual block.

FIG. 8 is a flowchart diagram of an example of a technique for transforming a large prediction residual block for a current block.

FIG. 9 is a flowchart diagram of an example of a technique for inverse transforming dequantized coefficients of a current block into a large prediction residual block.

DETAILED DESCRIPTION

Video compression schemes may include breaking respective images, or frames, into smaller portions, such as blocks, and generating an encoded bitstream using techniques to limit the information included for respective blocks thereof. The encoded bitstream can be decoded to re-create the source images from the limited information. For example, a video compression scheme can include transforming pixel values of a prediction residual block of a current block into transform coefficients. The transform coefficients are quantized and entropy coded into an encoded bitstream. A decoder uses the encoded transform coefficients to decode or decompress the encoded bitstream to prepare the video stream for viewing or further processing, such as by decoding and outputting the current block to an output video stream.

There may be many different transform sizes available for transforming the pixel values of a prediction residual block, such as based on the size of the prediction residual block representing the prediction residual. For example, where the prediction residual block is 16×16, the transform size may be 16×16, 8×8, or 4×4. In some cases, a codec may be able to support macroblocks larger than 32×32. In one example, a codec may include support for 32×64, 64×32, and 64×64 macroblocks. However, the processing of a macroblock of such a large size requires a large amount of computing resources and storage, which is infeasible in a practical video codec. A solution for transforms using less computing resources and storage is desirable, particularly given the growing presence of high resolution (e.g., 1080p, 4K, etc.) video and image content.

Implementations of this disclosure address problems such as these using improved transforms for large video and image blocks. During encoding, a prediction residual block having a large size (e.g., larger than 32×32) is generated. The pixel values of the prediction residual block are transformed to produce transform coefficients. After determining that the transform coefficients exceed a threshold cardinality representative of a maximum transform block size (e.g., 32×32), a number of the transform coefficients are discarded such that a remaining number of transform coefficients does not exceed the threshold cardinality. A transform block is then generated using the remaining number. During decoding, after determining that the transform coefficients exceed the threshold cardinality, a number of new coefficients are added to the transform coefficients such that a total number of transform coefficients exceeds the threshold cardinality. The transform coefficients are then inverse transformed into a prediction residual block having a large size.

References are made throughout this disclosure to transform coefficients represented by transform blocks. As used herein, the representation of a number of transform coefficients by a transform block size refers to the number of transform coefficients that are included in a transform block of that transform block size. For example, a 32×32 transform block represents 1,024 transform coefficients because a 32×32 transform block includes 1,024 transform coefficients. Thus, a statement or other expression that transform coefficients are represented by a 32×32 block size means that there are 1,024 such transform coefficients. That statement or other expression also means that the cardinality of those transform coefficients is 1,024.

Further details of techniques for improved transforms for large video and image blocks are described herein with initial reference to a system in which they can be implemented, as shown in FIGS. 1 through 7. FIG. 1 is a schematic of an example of a video encoding and decoding system 100. A transmitting station 102 can be, for example, a computer having an internal configuration of hardware such as that described in FIG. 2. However, other implementations of the transmitting station 102 are possible. For example, the processing of the transmitting station 102 can be distributed among multiple devices.

A network 104 can connect the transmitting station 102 and a receiving station 106 for encoding and decoding of the video stream. Specifically, the video stream can be encoded in the transmitting station 102, and the encoded video stream can be decoded in the receiving station 106. The network 104 can be, for example, the Internet. The network 104 can also be a local area network (LAN), wide area network (WAN), virtual private network (VPN), cellular telephone network, or any other means of transferring the video stream from the transmitting station 102 to, in this example, the receiving station 106.

The receiving station 106, in one example, can be a computer having an internal configuration of hardware such as that described in FIG. 2. However, other suitable implementations of the receiving station 106 are possible. For example, the processing of the receiving station 106 can be distributed among multiple devices.

Other implementations of the video encoding and decoding system 100 are possible. For example, an implementation can omit the network 104. In another implementation, a video stream can be encoded and then stored for transmission at a later time to the receiving station 106 or any other device having memory. In one implementation, the receiving station 106 receives (e.g., via the network 104, a computer bus, and/or some communication pathway) the encoded video stream and stores the video stream for later decoding. In an example implementation, a real-time transport protocol (RTP) is used for transmission of the encoded video over the network 104. In another implementation, a transport protocol other than RTP may be used (e.g., a Hypertext Transfer Protocol-based (HTTP-based) video streaming protocol).

When used in a video conferencing system, for example, the transmitting station 102 and/or the receiving station 106 may include the ability to both encode and decode a video stream as described below. For example, the receiving station 106 could be a video conference participant who receives an encoded video bitstream from a video conference server (e.g., the transmitting station 102) to decode and view and further encodes and transmits his or her own video bitstream to the video conference server for decoding and viewing by other participants.

In some implementations, the video encoding and decoding system 100 may instead be used to encode and decode data other than video data. For example, the video encoding and decoding system 100 can be used to process image data. The image data may include a block of data from an image. In such an implementation, the transmitting station 102 may be used to encode the image data and the receiving station 106 may be used to decode the image data. Alternatively, the receiving station 106 can represent a computing device that stores the encoded image data for later use, such as after receiving the encoded or pre-encoded image data from the transmitting station 102. As a further alternative, the transmitting station 102 can represent a computing device that decodes the image data, such as prior to transmitting the decoded image data to the receiving station 106 for display.

FIG. 2 is a block diagram of an example of a computing device 200 that can implement a transmitting station or a receiving station. For example, the computing device 200 can implement one or both of the transmitting station 102 and the receiving station 106 of FIG. 1. The computing device 200 can be in the form of a computing system including multiple computing devices, or in the form of one computing device, for example, a mobile phone, a tablet computer, a laptop computer, a notebook computer, a desktop computer, and the like.

A processor 202 in the computing device 200 can be a conventional central processing unit. Alternatively, the processor 202 can be another type of device, or multiple devices, capable of manipulating or processing information now existing or hereafter developed. For example, although the disclosed implementations can be practiced with one processor as shown (e.g., the processor 202), advantages in speed and efficiency can be achieved by using more than one processor.

A memory 204 in computing device 200 can be a read only memory (ROM) device or a random access memory (RAM) device in an implementation. However, other suitable types of storage device can be used as the memory 204. The memory 204 can include code and data 206 that is accessed by the processor 202 using a bus 212. The memory 204 can further include an operating system 208 and application programs 210, the application programs 210 including at least one program that permits the processor 202 to perform the techniques described herein. For example, the application programs 210 can include applications 1 through N, which further include a video or image coding application that performs the techniques described herein. The computing device 200 can also include a secondary storage 214, which can, for example, be a memory card used with a mobile computing device. Because the video communication sessions may contain a significant amount of information, they can be stored in whole or in part in the secondary storage 214 and loaded into the memory 204 as needed for processing.

The computing device 200 can also include one or more output devices, such as a display 218. The display 218 may be, in one example, a touch sensitive display that combines a display with a touch sensitive element that is operable to sense touch inputs. The display 218 can be coupled to the processor 202 via the bus 212. Other output devices that permit a user to program or otherwise use the computing device 200 can be provided in addition to or as an alternative to the display 218. When the output device is or includes a display, the display can be implemented in various ways, including by a liquid crystal display (LCD), a cathode-ray tube (CRT) display, or a light emitting diode (LED) display, such as an organic LED (OLED) display.

The computing device 200 can also include or be in communication with an image-sensing device 220, for example, a camera, or any other image-sensing device 220 now existing or hereafter developed that can sense an image such as the image of a user operating the computing device 200. The image-sensing device 220 can be positioned such that it is directed toward the user operating the computing device 200. In an example, the position and optical axis of the image-sensing device 220 can be configured such that the field of vision includes an area that is directly adjacent to the display 218 and from which the display 218 is visible.

The computing device 200 can also include or be in communication with a sound-sensing device 222, for example, a microphone, or any other sound-sensing device now existing or hereafter developed that can sense sounds near the computing device 200. The sound-sensing device 222 can be positioned such that it is directed toward the user operating the computing device 200 and can be configured to receive sounds, for example, speech or other utterances, made by the user while the user operates the computing device 200.

Although FIG. 2 depicts the processor 202 and the memory 204 of the computing device 200 as being integrated into one unit, other configurations can be utilized. The operations of the processor 202 can be distributed across multiple machines (wherein individual machines can have one or more processors) that can be coupled directly or across a local area or other network. The memory 204 can be distributed across multiple machines such as a network-based memory or memory in multiple machines performing the operations of the computing device 200. Although depicted here as one bus, the bus 212 of the computing device 200 can be composed of multiple buses. Further, the secondary storage 214 can be directly coupled to the other components of the computing device 200 or can be accessed via a network and can comprise an integrated unit such as a memory card or multiple units such as multiple memory cards. The computing device 200 can thus be implemented in a wide variety of configurations.

FIG. 3 is a diagram of an example of a video stream 300 to be encoded and subsequently decoded. The video stream 300 includes a video sequence 302. At the next level, the video sequence 302 includes a number of adjacent frames 304. While three frames are depicted as the adjacent frames 304, the video sequence 302 can include any number of adjacent frames 304. The adjacent frames 304 can then be further subdivided into individual frames, for example, a frame 306. At the next level, the frame 306 can be divided into a series of planes or segments 308. The segments 308 can be subsets of frames that permit parallel processing, for example. The segments 308 can also be subsets of frames that can separate the video data into separate colors. For example, a frame 306 of color video data can include a luminance plane and two chrominance planes. The segments 308 may be sampled at different resolutions.

Whether or not the frame 306 is divided into segments 308, the frame 306 may be further subdivided into blocks 310, which can contain data corresponding to, for example, 16×16 pixels in the frame 306. The blocks 310 can also be arranged to include data from one or more segments 308 of pixel data. The blocks 310 can also be of any other suitable size such as 4×4 pixels, 8×8 pixels, 16×8 pixels, 8×16 pixels, 16×16 pixels, or larger. Unless otherwise noted, the terms block and macroblock are used interchangeably herein.

FIG. 4 is a block diagram of an example of an encoder 400. The encoder 400 can be implemented, as described above, in the transmitting station 102, such as by providing a computer software program stored in memory, for example, the memory 204. The computer software program can include machine instructions that, when executed by a processor such as the processor 202, cause the transmitting station 102 to encode video data in the manner described in FIG. 4. The encoder 400 can also be implemented as specialized hardware included in, for example, the transmitting station 102. In one particularly desirable implementation, the encoder 400 is a hardware encoder.

The encoder 400 has the following stages to perform the various functions in a forward path (shown by the solid connection lines) to produce an encoded or compressed bitstream 420 using the video stream 300 as input: an intra/inter prediction stage 402, a transform stage 404, a quantization stage 406, and an entropy encoding stage 408. The encoder 400 may also include a reconstruction path (shown by the dotted connection lines) to reconstruct a frame for encoding of future blocks. In FIG. 4, the encoder 400 has the following stages to perform the various functions in the reconstruction path: a dequantization stage 410, an inverse transform stage 412, a reconstruction stage 414, and a loop filtering stage 416. Other structural variations of the encoder 400 can be used to encode the video stream 300.

When the video stream 300 is presented for encoding, respective adjacent frames 304, such as the frame 306, can be processed in units of blocks. At the intra/inter prediction stage 402, respective blocks can be encoded using intra-frame prediction (also called intra-prediction) or inter-frame prediction (also called inter-prediction). In any case, a prediction block can be formed. In the case of intra-prediction, a prediction block may be formed from samples in the current frame that have been previously encoded and reconstructed. In the case of inter-prediction, a prediction block may be formed from samples in one or more previously constructed reference frames.

Next, the prediction block can be subtracted from the current block at the intra/inter prediction stage 402 to produce a residual block (also called a residual). The transform stage 404 transforms the residual into transform coefficients in, for example, the frequency domain using block-based transforms. The quantization stage 406 converts the transform coefficients into discrete quantum values, which are referred to as quantized transform coefficients, using a quantizer value or a quantization level. For example, the transform coefficients may be divided by the quantizer value and truncated.

The quantized transform coefficients are then entropy encoded by the entropy encoding stage 408. The entropy-encoded coefficients, together with other information used to decode the block (which may include, for example, syntax elements such as used to indicate the type of prediction used, transform type, motion vectors, a quantizer value, or the like), are then output to the compressed bitstream 420. The compressed bitstream 420 can be formatted using various techniques, such as variable length coding (VLC) or arithmetic coding. The compressed bitstream 420 can also be referred to as an encoded video stream or encoded video bitstream, and the terms will be used interchangeably herein.

The reconstruction path (shown by the dotted connection lines) can be used to ensure that the encoder 400 and a decoder 500 (described below with respect to FIG. 5) use the same reference frames to decode the compressed bitstream 420. The reconstruction path performs functions that are similar to functions that take place during the decoding process (described below with respect to FIG. 5), including dequantizing the quantized transform coefficients at the dequantization stage 410 and inverse transforming the dequantized transform coefficients at the inverse transform stage 412 to produce a derivative residual block (also called a derivative residual). At the reconstruction stage 414, the prediction block that was predicted at the intra/inter prediction stage 402 can be added to the derivative residual to create a reconstructed block. The loop filtering stage 416 can be applied to the reconstructed block to reduce distortion such as blocking artifacts.

Other variations of the encoder 400 can be used to encode the compressed bitstream 420. In some implementations, a non-transform based encoder can quantize the residual signal directly without the transform stage 404 for certain blocks or frames. In some implementations, an encoder can have the quantization stage 406 and the dequantization stage 410 combined in a common stage.

FIG. 5 is a block diagram of an example of a decoder 500. The decoder 500 can be implemented in the receiving station 106, for example, by providing a computer software program stored in the memory 204. The computer software program can include machine instructions that, when executed by a processor such as the processor 202, cause the receiving station 106 to decode video data in the manner described in FIG. 5. The decoder 500 can also be implemented in hardware included in, for example, the transmitting station 102 or the receiving station 106.

The decoder 500, similar to the reconstruction path of the encoder 400 discussed above, includes in one example the following stages to perform various functions to produce an output video stream 516 from the compressed bitstream 420: an entropy decoding stage 502, a dequantization stage 504, an inverse transform stage 506, an intra/inter prediction stage 508, a reconstruction stage 510, a loop filtering stage 512, and a deblocking filtering stage 514. Other structural variations of the decoder 500 can be used to decode the compressed bitstream 420.

When the compressed bitstream 420 is presented for decoding, the data elements within the compressed bitstream 420 can be decoded by the entropy decoding stage 502 to produce a set of quantized transform coefficients. The dequantization stage 504 dequantizes the quantized transform coefficients (e.g., by multiplying the quantized transform coefficients by the quantizer value), and the inverse transform stage 506 inverse transforms the dequantized transform coefficients to produce a derivative residual that can be identical to that created by the inverse transform stage 412 in the encoder 400. Using header information decoded from the compressed bitstream 420, the decoder 500 can use the intra/inter prediction stage 508 to create the same prediction block as was created in the encoder 400 (e.g., at the intra/inter prediction stage 402).

At the reconstruction stage 510, the prediction block can be added to the derivative residual to create a reconstructed block. The loop filtering stage 512 can be applied to the reconstructed block to reduce blocking artifacts. Other filtering can be applied to the reconstructed block. In this example, the deblocking filtering stage 514 is applied to the reconstructed block to reduce blocking distortion, and the result is output as the output video stream 516. The output video stream 516 can also be referred to as a decoded video stream, and the terms will be used interchangeably herein. Other variations of the decoder 500 can be used to decode the compressed bitstream 420. In some implementations, the decoder 500 can produce the output video stream 516 without the deblocking filtering stage 514.

FIG. 6 is a diagram of example of functionality of a transform stage 600 used to transform a large prediction residual block. The transform stage 600 may, for example, be or include the transform stage 404 shown in FIG. 4. The prediction residual block may be block representing a prediction residual generated using a prediction stage 602, which may, for example, be or include the intra/inter prediction stage 402 shown in FIG. 4. After generating the prediction residual block, the transform stage 600 outputs the transformed prediction residual data within a transform block to a quantization stage 604, which may, for example, be the quantization stage 406 shown in FIG. 4.

The transform stage 600 includes a transform processor mechanism 606, a block size check mechanism 608, and a block truncation mechanism 610. The transform processor mechanism 606 transforms the pixel values of the prediction residual block to produce transform coefficients. The transform processor mechanism 606 transforms the pixel values of the prediction residual block according to a transform type (e.g., DCT) and a transform size. For example, the transform processor mechanism 606 can perform a transform search to determine an optimal transform type and an optimal transform size to use to transform the pixel values of the prediction residual block. The transform size may be selected based on a size of the prediction residual block.

The block size check mechanism 608 determines whether a large transform size was used to transform the prediction residual block. A large transform size refers to a size larger than 32×32. For example, a large transform size may be 32×64, 64×32, or 64×64. However, the large transform size may be a size defined based on the capabilities of the encoder that uses the transform stage 600 (e.g., the encoder 400 shown in FIG. 4). As such, in another example, a large transform size may be a size larger than 64×64.

The block size check mechanism 608 determines whether a large transform size was used by comparing the number of transform coefficients produced using the transform processor mechanism 606 to a threshold cardinality. The threshold cardinality represents a maximum transform block size (e.g., 32×32). That is, the threshold cardinality is the number of transform coefficients included within a transform block of the maximum transform block size.

The block truncation mechanism 610 selects which of the transform coefficients produced using the transform processor mechanism 606 will be included in a transform block generated using the transform stage 600. Where a determination is made that a large transform size was used to transform the prediction residual block, the block truncation mechanism 610 selects some of the transform coefficients and discards the rest. Discarding a transform coefficient can refer to deleting the data indicative or otherwise representative of the transform coefficient. Alternatively, discarding a transform coefficient can refer to ignoring the data indicative or otherwise representative of the transform coefficient, such as by flagging it. For example, flagged transform coefficients may not be included in the transform block generated using the transform coefficients.

The operations performed at the transform stage 600 can reduce the number of computations necessary for producing a transform block. For example, the transform stage 600 can remove one fourth of the computations needed by a typical transform stage to produce a transform block, such as due to the discarding of the transform coefficients. Other optimizations are also possible. Further, the transform block output from the transform stage 600 to the quantization stage 604 can be processed using typical scan patterns and quantization processes available to transform blocks generated for non-large prediction residual blocks (e.g., prediction residual blocks having a size of 32×32 or smaller). For example, the quantization stage 604 can use an M×N (e.g., 32×32, 16×32, etc.) quantization matrix to quantize the transform block output from the transform stage 600. The resulting quantized transform coefficients can then be entropy encoded, such as using a raster scan, zigzag, Z-shaped, or other scan order. The use of typical scan patterns and quantization processes obviates additional memory requirements.

In some implementations, the transform processor mechanism 606 performs a transform search against the pixel values of the prediction residual block. Performing the transform search includes determining rate-distortion values resulting from transforming the pixel values of the prediction residual block using different candidate combinations of transform types (e.g., DCT) and transform sizes. The one of the candidate combinations resulting in a lowest one of the rate-distortion values can then be selected. Data indicative of the selected transform type and transform size combination can be encoded to the bitstream, such as within syntax elements encoded to a block header for the current block, a frame header for the video frame, or the like.

In some implementations, the transform processor mechanism 606 can generate a transform block including the transform coefficients it produces. For example, the transform block generated using the transform processor mechanism 606 can be a first transform block having a size equal to a size of the prediction residual block received from the prediction stage 602. The block size check mechanism 608 can then determine whether a large transform size was used to transform the prediction residual block based on the size of the first transform block.

Where it is determined that a large transform size was used to transform the prediction residual block, the block truncation mechanism 610 can discard all of the transform coefficients except the transform coefficients located within an M×N (e.g., 32×32, 16×32, or smaller) space of the first transform block. As such, the block truncation mechanism 610 selects a first portion of the transform coefficients located within that M×N space and discards a second portion of the transform coefficients located outside of that M×N space. The M×N space may, for example, be the top-left most sub-block of the first transform block.

In some implementations, discarding the second portion of the transform coefficients can include generating a second transform block using only the first portion of the transform coefficients. For example, instead of deleting transform coefficients from the first transform block in which the first transform block remains the same size, a second transform block can be generated. The second transform block has a size corresponding to the number of transform coefficients within the first portion (e.g., the remaining transform coefficients).

In some implementations, the block truncation mechanism 610 can discard a number of the transform coefficients such that the remaining number of transform coefficients is less than the threshold cardinality. For example, where the threshold cardinality represents a 32×32 maximum transform block size, the block truncation mechanism 610 can discard a number of the transform coefficients such that the remaining number represents a 32×16, 16×32, 16×16, or smaller transform block size.

In some implementations, the block size check mechanism 608 may be omitted. For example, the determination of whether a large transform size was used to transform the prediction residual block can instead be made based on the operations performed by the transform processor mechanism 606. That is, a determination that a large transform size is used can be made simply by the use of a transform size greater than 32×32 by the transform processor mechanism 606.

In some implementations, the transform stage 600 can be used to process data other than video data. For example, the transform stage 600 can be used to process image data. The image data may include a block of data from an image. In such an implementation, the prediction stage 602 may be omitted or may be limited to using intra prediction modes. The transform operations may thus be performed on the image data rather than predicted video data.

FIG. 7 is a block diagram of example of functionality of an inverse transform stage 700 used to inverse transform dequantized coefficients into a large prediction residual block. The inverse transform stage 700 may, for example, be or include the inverse transform stage 506 shown in FIG. 5. The dequantized coefficients may be coefficients decoded from a bitstream (e.g., the compressed bitstream 420 shown in FIG. 5) and dequantized using a dequantization stage 702, which may, for example, be or include the dequantization stage 504 shown in FIG. 5. After dequantizing the encoded data to produce the dequantized coefficients, the inverse transform stage 700 outputs the inverse transformed dequantized coefficients as pixel values within a prediction residual block to a reconstruction stage 704, which may, for example, be the intra/inter prediction stage 508 shown in FIG. 5.

The inverse transform stage 700 includes a block size check mechanism 706, a block padding mechanism 708, and an inverse transform processor mechanism 710. The block size check mechanism 706 determines whether a large transform size was used to transform the transform coefficients dequantized at the dequantization stage 702. The block size check mechanism 706 determines whether a large transform size was used based on syntax elements decoded from the bitstream to which the transform coefficients were encoded. For example, the syntax elements can be data encoded to a block, frame, or other header within the bitstream and which indicates the transform size used.

The block padding mechanism 708 adds new coefficients to the transform coefficients where a determination was made that a large transform size was used. Adding the new coefficients includes adding a number of zero-value coefficients to the transform block to cause the size of the transform block to increase to the large transform size. For example, where a 64×64 transform size was used to produce the transform coefficients of the transform block and the transform block is of size 32×32, the block padding mechanism 708 adds three 32×32 sub-blocks full of zero-value coefficients to cause the transform block to increase to 64×64. In another example, where a 64×32 transform size was used to produce the transform coefficients of the transform block and the transform block is of size 32×32, the block padding mechanism adds one 32×32 sub-block full of zero-value coefficients to cause the transform block to increase to 64×32.

Adding the new coefficients can include not moving the locations of the existing transform coefficients within the transform block. For example, where a 64×64 transform size was used to produce the transform coefficients of the transform block and the transform block is of size 32×32, the existing transform coefficients will remain in the top-left most corner of the transform block. The three 32×32 sub-blocks to be added will be positioned to the right, bottom, and bottom-right of those existing transform coefficients.

The inverse transform processor mechanism 710 inverse transforms the coefficients of the transform block (e.g., the transform coefficients dequantized using the dequantization stage 702 and the new coefficients added using the block padding mechanism 708) to produce a prediction residual block for the current block. The inverse transform stage 700 outputs the prediction residual block to the reconstruction stage 704, which reconstructs the current block from the prediction residual block. The operations performed at the inverse transform stage 700 can reduce the number of computations necessary for inverse transforming transform coefficients. For example, the inverse transform stage 700 can use one fourth fewer computations compared to a typical inverse transform stage used to inverse transform transform coefficients, such as due to the padding of the added transform coefficients. Other optimizations are also possible. For example, the second half of the transform coefficients can be assumed to be zero values.

In some implementations, the block padding mechanism 708 can generate a new transform block including the transform coefficients dequantized using the dequantization stage 702 and the new coefficients it adds thereto. For example, the transform block including the transform coefficients dequantized using the dequantization stage 702 can be a first transform block having a size equal to a size of the dequantization matrix used at the dequantization stage 702. The block padding mechanism 708 can then generate a second transform block that includes the transform coefficients dequantized using the dequantization stage 702 and the new coefficients to be added thereto.

In some implementations, the inverse transform stage 700 can be used to process data other than video data. For example, the inverse transform stage 700 can be used to process image data. The image data may include a block of data from an image. The inverse transform operations may thus be performed on encoded image data rather than encoded video data.

Techniques for improved transforms for large video and image blocks are now described with respect to FIGS. 8 and 9. FIG. 8 is a flowchart diagram of an example of a technique 800 for transforming a large prediction residual block for a current block. FIG. 9 is a flowchart diagram of an example of a technique 900 for inverse transforming dequantized coefficients of a current block into a large prediction residual block.

The technique 800, the technique 900, or both can be implemented, for example, as a software program that may be executed by computing devices such as the transmitting station 102 or the receiving station 106. For example, the software program can include machine-readable instructions that may be stored in a memory such as the memory 204 or the secondary storage 214, and that, when executed by a processor, such as the processor 202, may cause the computing device to perform the technique 800, the technique 900, or both. The technique 800, the technique 900, or both can be implemented using specialized hardware or firmware. For example, a hardware component configured to perform the technique 800, the technique 900, or both. As explained above, some computing devices may have multiple memories or processors, and the operations described in the technique 800 or the technique 900 can be distributed using multiple processors, memories, or both.

For simplicity of explanation, the techniques described with respect to FIGS. 8 and 9 are each depicted and described as a series of steps or operations. However, the steps or operations in accordance with this disclosure can occur in various orders and/or concurrently. Additionally, other steps or operations not presented and described herein may be used. Furthermore, not all illustrated steps or operations may be required to implement a technique in accordance with the disclosed subject matter.

Referring first to FIG. 8, the technique 800 for transforming a large prediction residual block for a current block. At 802, a prediction residual block is generated for the current block. Generating the prediction residual block includes performing intra/inter prediction against the current block to generate a prediction block and then determining the difference between the current block and the prediction block. For example, the prediction residual block can be generated using the intra/inter prediction stage 402 shown in FIG. 4.

At 804, transform coefficients are produced by transforming pixel values of the prediction residual block. Transforming the pixel values of the prediction residual block can include transforming the pixel values using a transform type and a transform size. The transform type may, for example, be the discrete cosine transform or a different transform type. The transform size may be a size equal to or smaller than a size of the prediction residual block. For example, where the prediction residual block is a 64×64 block, the transform size may be 64×64, 64×32, 32×64, or smaller.

At 806, a determination is made as to whether a large transform size was used to produce the transform coefficients. Determining whether a large transform size was used to produce the transform coefficients includes determining whether the transform coefficients exceed a threshold cardinality. The threshold cardinality represents a maximum transform block size (e.g., 32×32). That is, the threshold cardinality is the number of transform coefficients included within a transform block of the maximum transform block size. Determining whether the transform coefficients exceed the threshold cardinality includes comparing the number of transform coefficients to the threshold cardinality.

Responsive to determining that a large transform size was used to produce the transform coefficients, at 808, a portion of the transform coefficients is discarded. Discarding the portion of the transform coefficients includes discarding a number of the transform coefficients such that a remaining number of the transform coefficients does not exceed the threshold cardinality. The portion of the transform coefficients to be discarded can be based on the total number of transform coefficients, and, therefore, based on the size of the prediction residual block.

For example, when the size of the prediction residual block is 64×64, three quarters of the transform coefficients are discarded such that the remaining transform coefficients are represented by a 32×32 block. In another example, when the size of the prediction residual block is 32×64 or 64×32, one half of the transform coefficients are discarded such that the remaining transform coefficients are represented by a 32×32 block.

At 810, a transform block is generated using the remaining number of the transform coefficients. Alternatively, responsive to determining that a large transform size was not used to produce the transform coefficients, at 812, a transform block is generated using all of the transform coefficients. At 814, the transform coefficients within the transform block generated at either 810 or 812 are quantized to produce quantized transform coefficients. As such, the quantizing of the transform block generated at 812 will result a greater number of quantized transform coefficients than the quantizing of the transform block generated at 810. At 816, the quantized transform coefficients are encoded.

In some implementations, the technique 800 includes performing a transform search against the pixel values of the prediction residual block. Performing the transform search includes determining rate-distortion values resulting from transforming the pixel values of the prediction residual block using different candidate combinations of transform types (e.g., DCT) and transform sizes. The one of the candidate combinations resulting in a lowest one of the rate-distortion values can then be selected. Data indicative of the selected transform type and transform size combination can be encoded to the bitstream, such as within syntax elements encoded to a block header for the current block, a frame header for the video frame, or the like.

In some implementations, determining whether the transform coefficients exceed the threshold cardinality can include comparing the size of the prediction residual block to the threshold cardinality. For example, the size of the prediction residual block can be compared to the maximum transform block size represented by the threshold cardinality. A determination that a large transform size was used to produce the transform coefficients can thus be made by determining that the size of the prediction residual block is larger than the maximum transform block size.

In some implementations, the operations for determining whether a large transform size was used to produce the transform coefficients may not include operations separate from the operations for producing the transform coefficients. For example, the determination as to whether a large transform size was used to produce the transform coefficients can be made by the transforming of the pixel values of the prediction residual block, such as based on a transform sized used therefor.

In some implementations, the technique 800 can be used to process data other than video data. For example, the technique 800 can be used to process image data. The image data may include a block of data from an image. In such an implementation, the technique 800 may omit operations for generating the prediction residual block or may be limited to using intra prediction modes to generate it. The transform operations may thus be performed on a block of pixel values of the image rather than predicted video data.

Referring next to FIG. 9, the technique 900 for inverse transforming dequantized coefficients of a current block into a large prediction residual block is shown. At 902, syntax data is decoded from a bitstream. The bitstream may, for example, be the compressed bitstream 420 shown in FIG. 4 or another bitstream output by an encoder. The syntax data may represent syntax elements, such as which may be encoded to a block header of the current block, a frame header of the video frame that includes the current block, or the like.

In particular, the syntax data includes data representing the quantized transform coefficients of the current block, which were encoded to the bitstream, as well as the transform type and transform size used by the encoder to produce those quantized transform coefficients. The quantized transform values are dequantized after being decoded from the bitstream. At 904, transform coefficients are produced by dequantizing the quantized transform coefficients of the current block decoded from the bitstream.

At 906, a determination is made as to whether a large transform size was used to produce the transform coefficients. The determination is made based on syntax elements decoded from the bitstream to which the transform coefficients were encoded. Responsive to a determination that a large transform size was used to produce the transform coefficients, at 908, a number of new coefficients is added to the transform coefficients. Adding the new coefficients includes adding a number of zero-value coefficients to the current transform coefficients such that the total number of transform coefficients exceeds a threshold cardinality.

The number of new coefficients to add is based on the number of current transform coefficients decoded and dequantized from the bitstream and the specific large transform size used. For example, where the number of current transform coefficients is represented by a 32×32 transform block and the transform size used to produce them is 64×64, three 32×32 sub-blocks full of zero-value coefficients are added. At 910, a prediction residual block is generated based on the total number of transform coefficients. Generating the prediction residual block includes inverse transforming the transform coefficients (subsequent to the new coefficients being added) according to the transform type indicated by the decoded syntax elements.

Alternatively, responsive to a determination that a large transform size was not used to produce the transform coefficients, at 912, a prediction residual block is generated based on the transform coefficients decoded and dequantized from the bitstream alone. At 914, the prediction residual block is reconstructed to generate a reconstructed block. At 916, the reconstructed block is output to a video stream, for example, the output video stream 516 shown in FIG. 5.

In some implementations, the technique 900 can be used to process data other than video data. For example, the technique 900 can be used to process image data. The image data may include a block of data from an image. In such an implementation, the technique 900 may omit operations for generating the prediction residual block or may be limited to using intra prediction modes to generate it. The inverse transform operations may thus be performed on encoded image data rather than encoded video data.

The aspects of encoding and decoding described above illustrate some examples of encoding and decoding techniques. However, it is to be understood that encoding and decoding, as those terms are used in the claims, could mean compression, decompression, transformation, or any other processing or change of data.

The word “example” is used herein to mean serving as an example, instance, or illustration. Any aspect or design described herein as “example” is not necessarily to be construed as being preferred or advantageous over other aspects or designs. Rather, use of the word “example” is intended to present concepts in a concrete fashion. As used in this application, the term “or” is intended to mean an inclusive “or” rather than an exclusive “or.” That is, unless specified otherwise or clearly indicated otherwise by the context, the statement “X includes A or B” is intended to mean any of the natural inclusive permutations thereof. That is, if X includes A; X includes B; or X includes both A and B, then “X includes A or B” is satisfied under any of the foregoing instances. In addition, the articles “a” and “an” as used in this application and the appended claims should generally be construed to mean “one or more,” unless specified otherwise or clearly indicated by the context to be directed to a singular form. Moreover, use of the term “an implementation” or the term “one implementation” throughout this disclosure is not intended to mean the same implementation unless described as such.

Implementations of the transmitting station 102 and/or the receiving station 106 (and the algorithms, methods, instructions, etc., stored thereon and/or executed thereby, including by the encoder 400 and the decoder 500) can be realized in hardware, software, or any combination thereof. The hardware can include, for example, computers, intellectual property (IP) cores, application-specific integrated circuits (ASICs), programmable logic arrays, optical processors, programmable logic controllers, microcode, microcontrollers, servers, microprocessors, digital signal processors, or any other suitable circuit. In the claims, the term “processor” should be understood as encompassing any of the foregoing hardware, either singly or in combination. The terms “signal” and “data” are used interchangeably. Further, portions of the transmitting station 102 and the receiving station 106 do not necessarily have to be implemented in the same manner.

Further, in one aspect, for example, the transmitting station 102 or the receiving station 106 can be implemented using a general purpose computer or general purpose processor with a computer program that, when executed, carries out any of the respective methods, algorithms, and/or instructions described herein. In addition, or alternatively, for example, a special purpose computer/processor can be utilized which can contain other hardware for carrying out any of the methods, algorithms, or instructions described herein.

The transmitting station 102 and the receiving station 106 can, for example, be implemented on computers in a video conferencing system. Alternatively, the transmitting station 102 can be implemented on a server, and the receiving station 106 can be implemented on a device separate from the server, such as a handheld communications device. In this instance, the transmitting station 102, using an encoder 400, can encode content into an encoded video signal and transmit the encoded video signal to the communications device. In turn, the communications device can then decode the encoded video signal using a decoder 500. Alternatively, the communications device can decode content stored locally on the communications device, for example, content that was not transmitted by the transmitting station 102. Other suitable transmitting and receiving implementation schemes are available. For example, the receiving station 106 can be a generally stationary personal computer rather than a portable communications device, and/or a device including an encoder 400 may also include a decoder 500.

Further, all or a portion of implementations of this disclosure can take the form of a computer program product accessible from, for example, a computer-usable or computer-readable medium. A computer-usable or computer-readable medium can be any device that can, for example, tangibly contain, store, communicate, or transport the program for use by or in connection with any processor. The medium can be, for example, an electronic, magnetic, optical, electromagnetic, or semiconductor device. Other suitable mediums are also available.

The above-described implementations and other aspects have been described in order to facilitate easy understanding of this disclosure and do not limit this disclosure. On the contrary, this disclosure is intended to cover various modifications and equivalent arrangements included within the scope of the appended claims, which scope is to be accorded the broadest interpretation as is permitted under the law so as to encompass all such modifications and equivalent arrangements. 

What is claimed is:
 1. A method for encoding a current block of a video frame, the method comprising: generating a prediction residual block for the current block, the prediction residual block including pixel values, the prediction residual block having a first size; at a transform stage of an encoder used for the encoding of the current block: transforming the pixel values of the prediction residual block to produce transform coefficients; determining that the transform coefficients exceed a threshold cardinality; responsive to determining that the transform coefficients exceed the threshold cardinality, discarding a number of the transform coefficients such that a remaining number of the transform coefficients does not exceed the threshold cardinality; and generating a transform block using the remaining number of the transform coefficients, the transform block having a second size smaller than the first size; quantizing the remaining number of the transform coefficients within the transform block to produce quantized transform coefficients; and encoding the quantized transform coefficients to a bitstream.
 2. The method of claim 1, wherein the threshold cardinality represents a maximum transform block size, wherein the first size of the prediction residual block is larger than the maximum transform block size.
 3. The method of claim 2, wherein determining that the transform coefficients exceed the threshold cardinality comprises: comparing the first size of the prediction residual block to the maximum transform block size.
 4. The method of claim 2, wherein the first size of the prediction residual block is one of 64×64, 32×64, or 64×32, wherein the maximum transform block size is 32×32.
 5. The method of claim 4, wherein, when the first size of the prediction residual block is 64×64, discarding the number of the transform coefficients such that the remaining number of the transform coefficients does not exceed the threshold cardinality comprises: discarding three quarters of the transform coefficients.
 6. The method of claim 4, wherein, when the first size of the prediction residual block is 32×64 or 64×32, discarding the number of the transform coefficients such that the remaining number of the transform coefficients does not exceed the threshold cardinality comprises: discarding one half of the transform coefficients.
 7. The method of claim 4, wherein the transform block is a second transform block, wherein transforming the pixel values of the prediction residual block to produce the transform coefficients comprises: generating a first transform block having the first size, the first transform block including the transform coefficients, wherein the remaining number of the transform coefficients are located in a top-left 32×32 sub-block of the first transform block.
 8. The method of claim 1, wherein transforming the pixel values of the prediction residual block to produce the transform coefficients comprises: transforming the pixel values using a discrete cosine transform.
 9. An apparatus for encoding a current block of a video frame, the apparatus comprising: a processor configured to execute instructions stored in a non-transitory storage medium to: generate a prediction residual block for the current block; at a transform stage of an encoder used for the encoding of the current block: transform pixel values of the prediction residual block to produce transform coefficients, the transform coefficients including a first portion and a second portion; determine that the transform coefficients exceed a threshold cardinality representing a maximum transform block size for the transform coefficients; and responsive to a determination that the transform coefficients exceed the threshold cardinality, generate a transform block without using the second portion of the transform coefficients, wherein the first portion of the transform coefficients does not exceed the threshold cardinality; quantize the first portion of the transform coefficients within the transform block to produce quantized transform coefficients; and encode the quantized transform coefficients to a bitstream.
 10. The apparatus of claim 9, wherein a size of the prediction residual block is larger than the maximum transform block size, wherein the instructions to determine that the transform coefficients exceed the threshold cardinality include instructions to: compare the size of the prediction residual block to the maximum transform block size.
 11. The apparatus of claim 9, wherein the instructions to generate the transform block without using the second portion of the transform coefficients include instructions to: discard the second portion of the transform coefficients; and generate the transform block using the first portion of the transform coefficients.
 12. The apparatus of claim 9, wherein a size of the prediction residual block is one of 64×64, 32×64, or 64×32, wherein the maximum transform block size is 32×32.
 13. The apparatus of claim 12, wherein, when the size of the prediction residual block is 64×64, the first portion of the transform coefficients represents one quarter of the transform coefficients and the second portion of the transform coefficients represents three quarters of the transform coefficients.
 14. The apparatus of claim 12, wherein, when the size of the prediction residual block is 32×64 or 64×32, the first portion of the transform coefficients represents a first half of the transform coefficients and the second portion of the transform coefficients represents a second half of the transform coefficients.
 15. The apparatus of claim 12, wherein the transform block is a second transform block, wherein the instructions to transform the pixel values of the prediction residual block to produce the transform coefficients include instructions to: generate a first transform block having the size of the prediction residual block, the first transform block including the first portion of the transform coefficients and the second portion of the transform coefficients, wherein the first portion of the transform coefficients are located in a top-left 32×32 sub-block of the first transform block.
 16. The apparatus of claim 9, wherein the instructions to transform the pixel values of the prediction residual block to produce the transform coefficients include instructions to: transform the pixel values using a discrete cosine transform.
 17. A method for encoding a current block of a video frame, the method comprising: generating a prediction residual block for the current block, the prediction residual block having a first block size; at a transform stage of an encoder used for the encoding of the current block: transforming pixel values of the prediction residual to produce transform coefficients, the transform coefficients including a first portion and a second portion; and generating a transform block using the first portion of the transform coefficients, the transform block having a second block size smaller than the first block size, wherein generating the transform block for the first portion of the transform coefficients includes discarding the second portion of the transform coefficients; quantizing the first portion of the transform coefficients within the transform block to produce quantized transform coefficients; and encoding the quantized transform coefficients to a bitstream.
 18. The method of claim 17, wherein generating the transform block using the first portion of the transform coefficients comprises: determining that the transform coefficients exceed a threshold cardinality; and responsive to determining that the transform coefficients exceed the threshold cardinality, discarding a number of the transform coefficients such that a remaining number of the transform coefficients does not exceed the threshold cardinality, wherein the discarded number of the transform coefficients is the second portion of the transform coefficients, wherein the remaining number of the transform coefficients is the first portion of the transform coefficients.
 19. The method of claim 18, wherein the threshold cardinality represents a maximum transform block size, wherein the first block size of the prediction residual block is larger than the maximum transform block size.
 20. The method of claim 19, wherein the first block size of the prediction residual block is one of 64×64, 32×64, or 64×32, wherein the maximum transform block size is 32×32, wherein, when the first block size of the prediction residual block is 64×64, discarding the number of the transform coefficients such that the remaining number of the transform coefficients does not exceed the threshold cardinality comprises discarding three quarters of the transform coefficients, and wherein, when the first block size of the prediction residual block is 32×64 or 64×32, discarding the number of the transform coefficients such that the remaining number of the transform coefficients does not exceed the threshold cardinality comprises discarding one half of the transform coefficients. 